{include file="public/headerbase" /} {include file="public/left" /}
<div class="right-content">
	<ol class="breadcrumb we7-breadcrumb">
		<li>
			<a href="{:url('Banner/index')}">企业介绍</a>
		</li>
		<li>
			编辑信息
		</li>
	</ol>
	<div class="clearfix">
		{foreach name="data" item="val"}
		<form action="{:url('Banner/xiugai')}" method="post" class="we7-form" role="form" id="form1" enctype="multipart/form-data">
			
			<div class="form-group">
				<label class="col-sm-2 control-label">图片</label>
				<div class="col-sm-8">
				<input type="file" name="bimg" id="file0" multiple="multiple" style="display: inline-block;" />
				<span style="color: red;margin-left: 50px ">*图片尺寸750*425</span>
				<br><img src="/uploads/{$val['bimg']}" id="img0" style="height:100px;">
				<input type="hidden" name="bimg" value="{$val['bimg']}" />
				</div>
			</div>
			<div class="form-group">
				<div class="">
					<input type="hidden" name="bid" value="{$val['bid']}" />
					<input type="submit" class="btn btn-primary" value="提交" />
				</div>
			</div>
		</form>
		{/foreach}
	</div>
	<script>
	$("#file0").change(function(){
	var objUrl = getObjectURL(this.files[0]) ;
	console.log("objUrl = "+objUrl) ;
	if (objUrl) {
		$("#img0").attr("src", objUrl) ;
	}
	}) ;
	//建立一個可存取到該file的url
	function getObjectURL(file) {
		var url = null ; 
		if (window.createObjectURL!=undefined) { // basic
			url = window.createObjectURL(file) ;
		} else if (window.URL!=undefined) { // mozilla(firefox)
			url = window.URL.createObjectURL(file) ;
		} else if (window.webkitURL!=undefined) { // webkit or chrome
			url = window.webkitURL.createObjectURL(file) ;
		}
		return url ;
	}
	</script>
</div>
</div>
</div>
</div>
</div>
{include file="public/footer" /}